<template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :params="fetchParams"
      :fetchapi="fetchapi"
      :datakey="'records'"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="selectChange"
      selectionType="single"
      :is-select-column="false"
    >
    </FilterTable>
  </div>
</template>
<script>
  import { getChangeRecord } from '@/api/claim/factory/AuthCheck';
  export default {
    props:['authId'],
    // mixins: [dictionary],
    data() {
      return {
        visible: false,
        visibleDrawer: false,
        collapse: false,
        infoId: null,
        // topFilterInit: this.topFilterInitFun(),
        flterValue: {}, //参数
        columns: this.creatHeader(),
        fetchapi: getChangeRecord,
        fetchParams: {  authId:this.authId }, //ipa 接口
        selectedRows: [], //选中经销商
        saveData: null,
        activeName: '',
        menus: [
          {
            title: '审核记录',
            path: 'tabs/user',
            params: {
              type: 1
            }
          },
          {
            title: '维修历史',
            path: 'tabs/setting',
            disabled: true,
            params: {
              type: 2
            }
          }
        ]
      };
    },
    created() {

    },
    methods: {
      formChangeHandle(val) {
        console.log(val);
        this.saveData = val;
      },
      //搜索获取数据
      changeHandle(val) {
        this.fetchParams = Object.assign({}, this.fetchParams, val);
        console.log(val);
      },
      //选中
      selectChange(rows) {
        this.selectedRows = rows;
        console.log(this.selectedRows);
      },
      //保存
      saveDialog() {
        this.$refs.formPanel1.SUBMIT_FORM();
        if (this.saveData) {
          this.$emit('save', this.selectedRows);
        }
      },
      //取消操作
      closeDialog() {
        this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
      },
      chooseOrderNo() {
        this.visible = true;
      },
      add() {},

      //table表头和数据源
      creatHeader() {
        return [
          {
            title: '序号',
            dataIndex: 'index',
            width: 80,
            sorter: true,
            render: props => {
              return <span>{props.row.index + 1}</span>;
            }
          },
          { title: '所有者代码', dataIndex: 'ownerCode', sorter: true },
          { title: '预授权编码', dataIndex: 'authNo', sorter: true },
          { title: '创建时间', dataIndex: 'createdAt', sorter: true },
          { title: '新内容', dataIndex: 'newContent', sorter: true },
          { title: '原内容', dataIndex: 'oldContent', sorter: true }

        ];
      }
    }
  };
</script>

<style lang="less" scoped></style>
